

function open_div(name){
    $("#"+name).fadeIn("1000");
}

function close_div(name){
    $("#"+name).fadeOut("1000");
}

function register(){
	
}

function toUserInfo(){
	location.href="front/user/toUserInfo";
}

function toShopCar(){
	location.href="front/shopCar/toShopCar";
}

function addShopCar(commid){
	$.ajax({
		url:'front/shopCar/add/'+commid,
		type:'POST',
		dataType:'JSON',
		success:function(data){
			if(data.code=='0000'){
				alert(data.msg);
			}else{
				alert(data.msg);
			}
		}
	});
}

function exit(){
	$.ajax({
		url:'front/user/exit',
		type:'POST',
		dataType:'JSON',
		success:function(data){
			if(data.code=='0000'){
				alert("登出成功");
				$("#user_head").html('<ul class="list-inline pull-right">Hi,尊敬的用户，您可以<li><a href="javascript:open_div(\'loginDIV\')" ><i class="fa fa-user"></i> 登录</a></li><li><a class="register" href="javascript:open_div(\'registerDIV\')" >注册</a></li></ul>');
			}else{
				alert("登出错误");
			}
		}
	});
}

